package cn.dliyy.warehouse.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.dliyy.base.dao.HQL;
import cn.dliyy.base.service.CommonService;
import cn.dliyy.warehouse.bean.BUnit;
import cn.dliyy.warehouse.dao.EntityDao;

@Service
public class UnitService extends CommonService{
  @Resource
  private EntityDao entityDao;
  @Resource
  private HQL hql;

  @Transactional
  public List<Object> getUnitList() {
    List<Object> list = entityDao.createQuery(hql.getListHQL(BUnit.class));
    return list;
  }

  public BUnit get(String id) {
    BUnit bUnit = (BUnit) super.get(BUnit.class, id);
    return bUnit;
  }

  public void save(BUnit BUnit) {
    entityDao.save(BUnit);
  }

  public void update(BUnit BUnit) {
    entityDao.update(BUnit);
  }

  public void delete(BUnit BUnit) {
    entityDao.delete(BUnit);
  }
}
